﻿<!DOCTYPE html>
<html>
<head>
    <title>Glimpse - Configuration Page</title>
    <link rel="shortcut icon" href="$glimpseFaviconUri$" />
    <link href="$configurationStyleUri$" media="all" rel="stylesheet" type="text/css" />
</head>
    <body>
        <header>
            <input type="hidden" id="glimpseRuntimeVersion" name="glimpseRuntimeVersion" value="$glimpseRuntimeVersion$"/>
            <div class="inner">
                <table>
                    <tr>
                        <td class="logo">
                            <a href="http://getglimpse.com/" title="Glimpse Home :D">
                                <img width="325" src="$glimpseLogoUri$" alt="Glimpse Home :D" /></a>
                        </td>
                        <td class="detail">
                            <div class="version">
                                v$glimpseRuntimeVersion$ <span>(core)</span>
                            </div>  
                            <h2>Bookmarklets
                                <div class="message">“Drag us to your favorites bar for quick and easy access to Glimpse”</div>
                            </h2>
                            <a href="http://getglimpse.com/Help/First-Run#Glimpse-Bookmarklets" class="find-more" target="new">find out more</a>
                            <a id="buttonTurnGlimpseOn" class="button" href="javascript:(function(){document.cookie='glimpsePolicy=On;path=/;expires=Sat, 01 Jan 2050 12:00:00 GMT;';window.location.reload();})();">Turn Glimpse On</a>
                            <a id="buttonTurnGlimpseOff" class="button" href="javascript:(function(){document.cookie='glimpsePolicy=;path=/;expires=Sat, 01 Jan 2050 12:00:00 GMT;';window.location.reload();})();">Turn Glimpse Off</a>
                            <a id="buttonSetSessionName" class="button" href="javascript:(function(){document.cookie='glimpseId='+ prompt('Client Name?') +';path=/;expires=Sat, 01 Jan 2050 12:00:00 GMT;';window.location.reload();})();">Set Glimpse Session Name</a>
                        </td>
                    </tr>
                </table>
            </div>
        </header>
        <div class="inner">
            $if(hasDuplicateResources)$
            <div class='notification notification-fail'>
                <strong>Houston we have a problem :(</strong>
                <br />
                We have detected that the following resources have been duplicated - 
            
                $duplicateResources: {duplicateResource|
                $if(duplicateResource.IsNotFirstDuplicate)$
                , 
                $endif$    
                <strong>$duplicateResource.Name$</strong>
                }$
            
                . Typically when this happens, Glimpse will fail to operate correctly and lead to ambiguous references.
            </div>
            $endif$
            
            <div id="outdatedMessage" class='out-dated'></div>
            
            <!--Configuration generator-->
            <div class="configuration-holder"><h3>Configuration Helper</h3>
                <div class="description warn">NOTE: The below is <strong>only designed</strong> to help generate the config which needs be copied over to your <strong>web.config</strong></div>
                <div class="close-section button button-small">x</div>
                <div class="code-holder">
                    <pre class="code-content">&lt;glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd"&gt;</pre>

                    <pre class="code-content code-logging configuration-options-item">    &lt;logging level="Trace" /&gt;</pre>
                                                                                    
                    <pre class="code-comment code-content code-section-tabs-off">
    &lt;!-- Tab Management
    &lt;tabs&gt;
        &lt;ignoredTypes&gt;
            &lt;add type="{Namespace.Type, AssemblyName}"/&gt;
        &lt;/ignoredTypes&gt;
    &lt;/tabs&gt;
    --></pre>

                    <div class="code-content code-section-tabs code-section-child" data-altState="code-section-tabs-off">
                        <pre>    &lt;tabs&gt;</pre>
                        <div class="code-tabs-ignoredTypes">
                            <pre>        &lt;ignoredTypes&gt;</pre>
                            <div class="code-ignoredTypes-options-tabs code-ignoredTypes-options"></div>
                            <pre>        &lt;/ignoredTypes&gt;</pre>
                        </div>
                        <pre>    &lt;/tabs&gt;</pre>
                    </div>

                    <pre class="code-comment code-content code-section-runtimePolicies-off">
    &lt;!-- Runtime Policy Management
    &lt;runtimePolicies&gt;
        &lt;ignoredTypes&gt;
            &lt;add type="{Namespace.Type, AssemblyName}"/&gt;
        &lt;/ignoredTypes&gt;
    &lt;/runtimePolicies&gt;
    --></pre>

                    <div class="code-content code-section-runtimePolicies code-section-child" data-altState="code-section-runtimePolicies-off">
                        <pre>    &lt;runtimePolicies&gt;</pre>
                        <div class="code-runtimePolicies-ignoredTypes">
                            <pre>        &lt;ignoredTypes&gt;</pre>
                            <div class="code-ignoredTypes-options-runtimePolicies code-ignoredTypes-options"></div>
                            <pre>        &lt;/ignoredTypes&gt;</pre>
                        </div>
                        <div class="code-runtimePolicies-blacklist configuration-options-item">
                            <pre>       &lt;uris&gt;
            &lt;add regex=".*/admin.*"/&gt;
        &lt;/uris&gt;</pre>
                        </div>
                        <div class="code-runtimePolicies-statusCodes configuration-options-item">
                            <pre>       &lt;statusCodes&gt;
            &lt;add statusCode="404"/&gt;
        &lt;/statusCodes&gt;</pre>
                        </div>
                        <div class="code-runtimePolicies-contentTypes configuration-options-item">
                            <pre>       &lt;contentTypes&gt;
            &lt;add contentType="application/xml"/&gt;
        &lt;/contentTypes&gt;</pre>
                        </div>
                        <pre>    &lt;/runtimePolicies&gt;</pre>
                    </div>
                
                    <div class="code-content code-section-inspectors code-section-child">
                        <pre>    &lt;inspectors&gt;</pre>
                        <div class="code-inspectors-ignoredTypes">
                            <pre>        &lt;ignoredTypes&gt;</pre>
                            <div class="code-ignoredTypes-options-inspectors code-ignoredTypes-options"></div>
                            <pre>        &lt;/ignoredTypes&gt;</pre>
                        </div>
                        <pre>    &lt;/inspectors&gt;</pre>
                    </div>

                    <pre class="code-content">&lt;/glimpse&gt;</pre>

                    <ul class="configuration-options">
                        <li>Tab Management - Individual Tabs can be disabled by instructing Glimpse to ignore their types</li>
                        <li>Runtime Policy Management - Individual Policies can be disabled by instructing Glimpse to ignore their types
                        <ul>
                            <li><input type="checkbox" data-show="code-runtimePolicies-contentTypes">Content Types - Filter what specific Content Types Glimpse will be enabled for</li>
                            <li><input type="checkbox" data-show="code-runtimePolicies-blacklist">Blacklist URIs - Filter Glimpse to only work on URIs that match specifc regular expressions</li>
                            <li><input type="checkbox" data-show="code-runtimePolicies-statusCodes">Status Codes - Filter what specific Status Codes Glimpse will be enabled for</li>
                        </ul>
                        <li><input type="checkbox" data-show="code-logging">Logging - An internal Glimpse diagnostics log can be enabled to help troubleshoot problems with Glimpse</li>
                    </ul>
                    <div class="center"><a href="http://getglimpse.com/Help/Configuration">find out more online</a></div>
                </div>
            </div>
            <div class="side-bar">
                <div id="currentGlimpseCookieStatus" class="notification"></div>
                <!--Configuration help-->
                <div class="more-help">
                    <h3>Configuration Help?</h3>
                    Want to learn more about configuring Glimpse or how to disable Tabs or Policies?<br />
                    <a href="javascript:return true;" class="config-open button button-small">Start Config Helper</a>
                </div>  <!--head over to our <a href="http://getglimpse.com/Help/Configuration" target="new">config help page</a>-->
                <!--Logging help-->
                <div class="more-help">
                    <h3>Glimpse Logging?</h3>
                    Have an issue? help us figure it out by turning on logging.<br />
                    <a href="javascript:return true;" class="logging-on button button-small">Find Out How</a>
                </div>
            </div>
            <h3>Standard Settings</h3>
            <ul class="root">
                <li><strong>Tabs</strong>:
                    <ul class="code-ignoredTypes-controller" data-link="code-ignoredTypes-options-tabs">
                        $tabsByPackage: {tabsForPackage|
                        <li>
                            <strong>$tabsForPackage.PackageName$</strong> <span class="package-version">$tabsForPackage.PackageVersion$</span>
                            <ul>
                                $tabsForPackage.ContainedItems: {tab|
                                <li>
                                    <input type="checkbox" data-type="$tab.Type$, $tab.AssemblyName$" checked="checked" />
                                    <strong>$tab.Name$</strong> - <span class="code">$tab.Type$</span>
                                    <span class="more-detail"> - <em>$tab.ExecuteOn$</em></span>
                                </li>
                                }$
                            </ul>
                        </li>    
                        }$
                    </ul>
                    <br/>Want to create your own Tabs - <a href="http://getglimpse.com/Help/Custom-Tabs" target="new">see here!</a>
                </li>
                <li><strong>Runtime Policies</strong>: 
                    <ul class="code-ignoredTypes-controller" data-link="code-ignoredTypes-options-runtimePolicies">
                        $runtimePoliciesByPackage: {runtimePoliciesForPackage|
                        <li>
                            <strong>$runtimePoliciesForPackage.PackageName$</strong> <span class="package-version">$runtimePoliciesForPackage.PackageVersion$</span>
                            <ul>
                                $runtimePoliciesForPackage.ContainedItems: {runtimePolicy|
                                <li>
                                    <input type="checkbox" data-type="$runtimePolicy.Type$, $runtimePolicy.AssemblyName$" checked="checked" />
                                    <span class="code">$runtimePolicy.Type$</span>
                                    <span class="more-detail"> - <em>$runtimePolicy.ExecuteOn$</em></span>
                                    $if(runtimePolicy.HasWarningMessage)$
                                    <span class="more-detail"><br/></span><strong class="warn">$runtimePolicy.WarningMessage$</strong>
                                    $endif$
                                </li>
                                }$
                            </ul>
                        </li>    
                        }$
                    </ul>
                    <br/>Learn how to create your own policies - <a href="http://getglimpse.com/Help/Custom-Runtime-Policy" target="new">see here!</a>
                </li>
            </ul>
        
            <!--Toggle details-->
            <a id="showDetails" class="more-detail">More details?</a>
            <a id="hideDetails" class="more-detail">Less details?</a>

            <div class="more-detail">
                <h3>Detailed Settings:</h3>
                <ul class="root">
                    <li><strong>Inspectors</strong>: 
                        <ul class="code-ignoredTypes-controller" data-link="code-ignoredTypes-options-inspectors">
                            $inspectorsByPackage: {inspectorsForPackage|
                            <li>
                                <strong>$inspectorsForPackage.PackageName$</strong> <span class="package-version">$inspectorsForPackage.PackageVersion$</span>
                                <ul>
                                    $inspectorsForPackage.ContainedItems: {inspector|
                                    <li>
                                        <input type="checkbox" data-type="$inspector.Type$, $inspector.AssemblyName$" checked="checked" />
                                        <span class="code">$inspector.Type$</span>
                                    </li>
                                    }$
                                </ul>
                            </li>    
                            }$
                        </ul>
                    </li>
                    <li><strong>Resources</strong>: 
                        <ul>
                            $resourcesByPackage: {resourcesForPackage|
                            <li>
                                <strong>$resourcesForPackage.PackageName$</strong> <span class="package-version">$resourcesForPackage.PackageVersion$</span>
                                <ul>
                                    $resourcesForPackage.ContainedItems: {resource|
                                    <li>
                                        <strong>$resource.Name$</strong> - <span class="code">$resource.Type$</span> - <em>$resource.Parameters$</em>
                                        $if(resource.HasDuplicate)$
                                        <strong class="warn">*Duplicate*</strong>
                                        $endif$
                                    </li>
                                    }$
                                </ul>
                            </li>    
                            }$
                        </ul>
                    </li>
                    <li><strong>Client Scripts</strong>: 
                        <ul>
                            $clientScriptsByPackage: {clientScriptsForPackage|
                            $clientScriptsForPackage.ContainedItems: {clientScript|
                            <li>
                                <span class="code">$clientScript.Type$</span> - $clientScript.Order$
                            </li>
                            }$
                            }$
                        </ul>
                    </li>
                    <li><strong>Framework Provider</strong>: <span class="code">$frameworkProviderType$</span></li>
                    <li><strong>Html Encoder</strong>: <span class="code">$htmlEncoderType$</span></li>
                    <li><strong>Logger</strong>: <span class="code">$loggerType$</span></li>
                    <li><strong>Persistence Store</strong>: <span class="code">$persistenceStoreType$</span></li>
                    <li><strong>Resource Endpoint</strong>: <span class="code">$resourceEndpointType$</span></li>
                    <li><strong>Serializer</strong>: <span class="code">$serializerType$</span></li>
                    <li><strong>Default Resource</strong>: <span class="code">$defaultResourceType$</span> - <em>$defaultResourceName$</em></li>
                    <li><strong>Default Runtime Policy</strong>: <span class="code">$defaultRuntimePolicyType$</span></li>
                    <li><strong>Proxy Factory</strong>: <span class="code">$proxyFactoryType$</span></li>
                    <li><strong>Message Broker</strong>: <span class="code">$messageBrokerType$</span></li>
                    <li><strong>Endpoint Base Uri</strong>: <span class="code">$endpointBaseUri$</span></li>
                </ul>
                <h3>Registered Packages:</h3>
                <p>NOTE, doesn't represent all the Glimpse dependent NuGet packages you have installed, just the ones that have registered as a NuGet package</p>
                <ul>
                    $registeredNuGetPackages: {registeredNuGetPackage|
                    <li>$registeredNuGetPackage.Id$ - $registeredNuGetPackage.Version$</li>
                    }$
                </ul>
                $if(hasNonProcessableAssemblies)$
                <strong class="warn">The following assemblies could not be processed during NuGet package discovery. Check log for more details.</strong>
                <ul>
                    $nonProcessableAssemblies: {nonProcessableAssembly|
                    <li>$nonProcessableAssembly$</li>
                    }$
                </ul>
                $endif$
            </div>
        </div>
        <footer>
            <div class="inner">
                <p class="center">For more info see <a href="http://getglimpse.com">getGlimpse.com</a></p>
                <div class="center">
                    <img src="$githubLogoUri$"> Found an <em>error</em>? <a href="https://github.com/glimpse/glimpse/issues">Help us improve</a>.   
                    <img src="$twitterLogoUri$"> Have a <em>question</em>? <a href="http://twitter.com/#search?q=%23glimpse">Tweet us using #glimpse</a>.
                </div>
            </div>
        </footer>
        <script type="text/javascript" src="$configurationScriptUri$"></script>
    </body>
</html>